<!DOCTYPE html>
<html lang="">
<head>
	<meta charset="utf-8">
	<title>Modal</title>	
	<link rel="stylesheet" type="text/css" href="./css/modal.css">
	<link rel="stylesheet" type="text/css" href="./css/theme.css">
	<link rel="stylesheet" type="text/css" href="./css/transition.css">
	<style>
		* {padding: 0; margin: 0;}
		button {padding: 2px 12px; margin: 100px 50px 0 10px;}
	</style>
</head>
<body>
	<button id="scale">scale</button>
	<button id="slide">slide</button>
	<button id="fade">fade</button>
	<button id="center">center</button>
	<button id="fullscreen">fullscreen</button>	
	<button id="alert">alert</button>
	<button id="prompt">prompt</button>
	<script type="text/javascript" src="./script/jquery.js"></script>
	<script type="text/javascript" src="./script/jquery.modal.js"></script>
	<script>
		$(function () {	
			var $scale = $('#scale'),
				$slide = $('#slide'),
				$fade = $('#fade'),
				$center = $('#center'),
				$fullscreen = $('#fullscreen'),
				$alert = $('#alert'),
				$prompt = $('#prompt');

			//  缩放显示
			$scale.on('click', function (e) {
				e.preventDefault();
				$.modal()
					.done(function () {alert('您点击了确认');})
					.fail(function () {alert('您点击了取消');});
			});	

			//  滑动显示
			$slide.on('click', function (e) {
				e.preventDefault();
				$.modal({
					content : 'content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>content',
					backdrop : true,
					theme : 'theme_b',
					transition : 'slide',
				})
				.done(function () {alert('您点击了确认');})
				.fail(function () {alert('您点击了取消');});
			});	

			//  淡入淡出
			$fade.on('click', function (e) {
				e.preventDefault();
				$.modal({
					transition : 'fade',
				})
				.done(function () {alert('您点击了确认');})
				.fail(function () {alert('您点击了取消');});
			});

			//  居中显示
			$center.on('click', function (e) {
				e.preventDefault();
				$.modal({
					center: true,
				})
				.done(function () {alert('您点击了确认');})
				.fail(function () {alert('您点击了取消');});
			});

			//  全屏显示
			$fullscreen.on('click' , function (e) {
				e.preventDefault();
				$.modal({
					fullscreen : true,
					backdrop: true,
				})
				.done(function () {alert('您点击了确认');})
				.fail(function () {alert('您点击了取消');});
			});

			//  alert
			$alert.on('click', function (e) {
				e.preventDefault();
				$.alert()
					.done(function () {alert('您点击了确认');})
					.fail(function () {alert('您点击了取消');});
			})

			//  prompt
			$prompt.on('click', function (e) {
				e.preventDefault();
				$.prompt()
					.done(function () {
						alert(prompt_content);
					})
					.fail(function () {
						alert('您点击了取消');
					})
			})

		});
	</script>
</body>
</html>
